﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IRC.IRepairClouds.DataLayer;
using IRC.IRepairClouds.DataLayer.Cache;

[assembly: WebResource("IRC.IRepairClouds.WebClient.Cases.CaseSearch.debug.js", "text/javascript")]
[assembly: WebResource("IRC.IRepairClouds.WebClient.Cases.CaseSearch.js", "text/javascript")]

namespace IRC.IRepairClouds.WebClient.Cases
{
    public partial class CaseSearch : BasePages.BaseAuthPage
    {

        public override bool DisableViewstateCompletely
        {
            get { return true; }
        }

        public override bool RegisterIScripts
        {
            get { return true; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var ud = CacheManager.Users.Current;
                RadGridSearchResults.ClientHidePager();
            }
        }

        public override IEnumerable<ScriptDescriptor> GetScriptDescriptors()
        {
            ScriptControlDescriptor descriptor = new ScriptControlDescriptor("IRC.Pages.Cases.CaseSearch", Page.Form.ClientID);
            descriptor.AddComponentProperty("mainOwner", Page.Form.ClientID);
            yield return descriptor;
        }

        public static IEnumerable<ScriptReference> GetScriptReferencesStatic()
        {
            yield return new ScriptReference("IRC.IRepairClouds.WebClient.Cases.CaseSearch.js", "IRC.IRepairClouds.WebClient");
        }

        public override IEnumerable<ScriptReference> GetScriptReferences()
        {
            return GetScriptReferencesStatic();
        }

    }
}